Image processing apparatus and image processing method

ABSTRACT

A printing apparatus includes white and gray text determination units and a setting unit to charge a color printing fee where a pixel for which a color printing flag is set is present in an input image, and to charge a black-and-white printing fee where a pixel for which the color printing flag is set is not present in an input image. The white determination unit determines whether a focused pixel in the input image is a white pixel. The gray text determination unit determines whether the focused pixel constitutes a gray text. Where the focused pixel is determined to constitute a gray text or be a white pixel, the setting unit sets a black-and-white printing flag for the focused pixel and, where the focused pixel is determined to neither constitute a gray text nor be a white pixel, the color printing flag is set for the focused pixel.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image processing apparatus and animage processing method.

2. Description of the Related Art

A technique for automatically switching between color printing andmonochrome (black-and-white) printing has been known (e.g., JapanesePatent Application Laid-Open No. 2007-129449). The technique discussedin Japanese Patent Application Laid-Open No. 2007-129449 will bedescribed in detail below.

A printer driver determines whether a color object is included in red,green, and blue (RGB) document data. If at least one color object isincluded, the printer driver determines that the RGB document data iscolor. If no color object is included, the printer driver determinesthat the RGB document data is monochrome. The printer driver sends thedetermination result along with the RGB document data to a printer.

Having received the RGB document data, the printer bitmaps the RGBdocument data. This generates RGB bitmap data.

(1) If the received determination result indicates that the RGB documentdata is monochrome, the printer converts the generated RGB bitmap datainto single-K-color bitmap data, and prints the single-K-color bitmapdata. That is, the printer prints the converted single-K-color bitmapdata using only K ink or K toner. “K” represents black. In this case, amonochrome printing fee is charged for the printing of the document.

(2) If, on the other hand, the received determination result indicatesthat the RGB document data is color, the printer determines, in the RGBbitmap data, which pixel is to be printed in cyan, magenta, yellow, andblack (CMYK) colors and which pixel is to be printed in a single Kcolor. Specifically, the following processing is performed.

(A) First, the printer generates attribute bitmap data indicating theattribute of an object to which each pixel belongs. The attribute is anyone of, for example, “text”, “graphic”, “image”, and “nothing”.

(B) Then, the printer sets an attribute “single K color” for a pixelwhich has the attribute “text” or “graphic” and in which R=G=B. On theother hand, the printer sets an attribute “CMYK” for other pixels.

(C) The RGB values of the pixel for which the attribute “single K color”has been set are converted into the values of a single K color (C=M=Y=0,and K can be any value), and then, the pixel is printed. Further, theRGB values of the pixel for which the attribute “CMYK” has been set areconverted into the values of CMYK colors (at least one of C, M, and Y isnot 0 except for the case where R=G=B=255, and K can be any value), andthen, the pixel is printed. “C” represents cyan, “M” represents magenta,and “Y” represents yellow.

(D) If there is at least one pixel having the attribute “CMYK”, a colorprinting fee has been charged for the printing of the document. Further,if all the pixels have the attribute “single K color”, a monochromeprinting fee is charged for the printing of the document.

If the printer has not received the monochrome determination result fromthe printer driver, the printer charges a fee by performing processingsimilar to the processing in the above (2) and the subsequent steps,that is, the processing performed in the case where the color/monochromedetermination result indicates that the RGB document data is color.

According to the above determination method, however, an undesirablecolor printing fee may be charged in some cases. Such cases will bedescribed using an example illustrated in FIG. 1. FIG. 1 illustrates adocument 101, which includes a white image object 102 (although theframe line of the image object 102 is black for illustrative purposes,the image object 102 is actually white), and black text objects 104 and105. Since the document 101 includes the white image object 102,attribute bitmap data generated from the document 101 includes theattribute “image”. Thus, the printer determines the document 101 as acolor document. As a result, a color printing fee has been charged forthe printing of such a document, despite the fact that there is no pixelto be printed in color. More specifically, although RGB-to-CMYKconversion is applied to the white image object 102, the obtained valueswould be C=M=Y=K=0 because, originally, R=G=B=255. SinceRGB-to-single-K-color conversion is applied to the black text objects104 and 105, the obtained values would be C=M=Y=0.

SUMMARY OF THE INVENTION

According to an aspect of the present invention, a printing apparatus tocharge a color printing fee in a case where a pixel for which a colorprinting flag is set is present in an input image, and to charge ablack-and-white printing fee in a case where a pixel for which the colorprinting flag is set is not present in an input image, includes a whitedetermination unit configured to determine whether a focused pixel inthe input image is a white pixel, a gray text determination unitconfigured to determine whether the focused pixel constitutes a graytext, and a setting unit configured to, in a case where the focusedpixel is determined to constitute a gray text or be a white pixel, set ablack-and-white printing flag for the focused pixel and, in a case wherethe focused pixel is determined to neither constitute a gray text nor bea white pixel, set the color printing flag for the focused pixel.

In a case where a focused pixel is determined to be not a white pixel,an image processing apparatus sets a color printing flag for the focusedpixel in a case where the focused pixel is a black-and-white pixel and aphotograph pixel. In a case where the focused pixel is determined to bea white pixel, the image processing apparatus sets a black-and-whiteprinting flag for the focused pixel even in a case where the focusedpixel is a photograph pixel. Further features of the present inventionwill become apparent from the following description of exemplaryembodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating an example where an unfavorable colorprinting fee is charged.

FIG. 2 is a diagram including blocks of a host computer.

FIG. 3 is a block diagram illustrating a configuration example of animage processing apparatus.

FIG. 4 is a flow chart illustrating an example of a processing flow ofprinting processing.

FIG. 5 is a flow chart illustrating an example of a processing flow ofcolor/monochrome determination processing of an image, performed in thehost computer.

FIG. 6 is a diagram illustrating relationships between an output modesetting, and color/monochrome determination results in the host computerand the image processing apparatus.

FIG. 7 is a flow chart illustrating an example of a processing flow ofcolor/monochrome determination processing of an image, performed in theimage processing apparatus.

FIG. 8 is a diagram illustrating determination results ofcolor/monochrome pixel determination made based on a pixel value and agray compensation flag, in color/monochrome pixel determination.

FIG. 9 is a diagram illustrating another example where an unfavorablecolor printing fee is charged.

DESCRIPTION OF THE EMBODIMENTS

Various exemplary embodiments, features, and aspects of the inventionwill be described in detail below with reference to the drawings. Theconfigurations illustrated in the following exemplary embodiments aremerely examples, and the present invention is not limited to theconfigurations illustrated in the figures.

FIG. 2 is a block diagram illustrating an example of an image processingsystem according to a first exemplary embodiment. The image processingsystem illustrated in FIG. 2 includes a host computer 200 and an imageprocessing apparatus 300. The host computer 200 is connected to theimage processing apparatus 300 via a network 201.

The host computer 200 includes an application control unit 202, a drivercontrol unit 203, and a communication control unit 204. The applicationcontrol unit 202 generates image data to be printed by the imageprocessing apparatus 300. The driver control unit 203 converts the imagedata generated by the application control unit 202 to generatepredetermined page description language (PDL) data. The communicationcontrol unit 204 transfers the PDL data generated by the driver controlunit 203 and image processing parameters set by the driver control unit203 to the image processing apparatus 300 via the network 201.

FIG. 3 is a detailed block diagram illustrating the image processingapparatus 300 in FIG. 2. The image processing apparatus 300 performsprinting using the PDL data sent from the host computer 200. The imageprocessing apparatus 300 includes a communication control unit 301, arendering unit 302, a monochrome/color determination unit 303, a colorspace conversion unit 304, a halftone processing unit 305, a printingunit 306, and a control unit 307.

The communication control unit 301 receives the PDL data and the imageprocessing parameters transferred from the host computer 200 via thenetwork 201. The rendering unit 302 renders the PDL data received by thecommunication control unit 301 to generate RGB format bitmap image data.The monochrome/color determination unit 303 determines whether the imagebitmapped by the rendering unit 302 is a monochrome image or a colorimage. The color space conversion unit 304 converts the bitmap imagedata generated by the rendering unit 302 into CMYK format image data,taking into account the result of the determination by themonochrome/color determination unit 303.

The halftone processing unit 305 performs halftone processing on theCMYK format image data converted by the color space conversion unit 304.The printing unit 306 performs the print output of the halftone imageobtained by the halftone processing by the halftone processing unit 305.The control unit 307 includes a central processing unit (CPU) (notillustrated), a random-access memory (RAM) (not illustrated), and aread-only memory (ROM)(not illustrated). The CPU executes program dataincluded in the ROM, using the RAM to control the component modulesincluded in the image processing apparatus 300. Further, the RAMincluded in the control unit 307 holds counter values for recording thenumbers of output color images and output monochrome images. The countervalues are counted up every time the printing unit 306 performsprocessing of printing one page according to a color/monochromedetermination result, which will be described in detail below. Based onthe counter values, the numbers of printed color images and printedmonochrome images can be recorded.

FIG. 4 is a flow chart illustrating a processing flow of a print job inthe present exemplary embodiment. In the flow of the printingprocessing, steps S401 to S404 (the steps on and above a dotted line inFIG. 4) represent the processing performed by the host computer 200.Further, steps S404 to S410 (the steps on and below the dotted line inFIG. 4) represent the processing performed by the image processingapparatus 300. The processing performed by the host computer 200 isachieved as follows. The host computer 200 includes a CPU (notillustrated), a ROM (not illustrated), a hard disk drive (HDD)(notillustrated), and a RAM (not illustrated), and the CPU executes aprogram stored in the ROM or the HDD and loaded into the RAM, wherebythe CPU functions as the components illustrated in FIG. 2. Further, theprocessing performed by the image processing apparatus 300 is achievedas follows. The CPU of the control unit 307 executes a program loadedinto the RAM of the control unit 307, whereby the control unit 307controls the components. Alternatively, the processing performed by theimage processing apparatus 300 may also be achieved by the CPU of thecontrol unit 307 functioning as the components illustrated in FIG. 3.

First, in step S401, the application control unit 202 of the hostcomputer 200 instructs the driver control unit 203 to execute a printjob so as to print a document image generated by the application controlunit 202. The document image is generated in a format according to eachapplication. Next, in step S402, the driver control unit 203 convertsthe document image into PDL data that can be interpreted by the imageprocessing apparatus 300. At this time, the document image is convertedinto PDL data in a format according to the type of the driver(PostScript (PS), Printer Command Language (PCL), or Laser beam printerImage Processing System (LIPS)). In step S403, the driver control unit203 makes color/monochrome determination of the converted PDL data. Thisprocessing will be described in detail below.

In step S404, the driver control unit 203 collectively transfers piecesof data such as the generated PDL data, image processing parameters, anda color/monochrome determination result from the communication controlunit 204 to the image processing apparatus 300 via the network 201. Thecolor/monochrome determination result refers to the result of thecolor/monochrome determination made in step S403. The determinationprocessing will be described below. The color/monochrome determinationresult to be sent at this time is information indicating whether the PDLdata is color or monochrome, but the information indicating whether thePDL data is color or monochrome does not necessarily need to be sent.For example, in a case where the printer driver and the image processingapparatus 300 have such an arrangement that only if the PDL data ismonochrome, information indicating that the PDL data is monochrome issent, only information indicating that the PDL data is monochrome issent as the color/monochrome determination result. That is, in a casewhere information indicating that the PDL data is monochrome has beensent with the PDL data, the image processing apparatus 300 may determinethat the sent PDL data is monochrome. Further, in a case whereinformation indicating that the PDL data is monochrome has not been sentwith the PDL data, the image processing apparatus 300 may determine thatthe sent PDL data is color. As a matter of course, conversely, theprinter driver and the image processing apparatus 300 may have such anarrangement that only information indicating that the PDL data is coloris sent. In short, as the above color/monochrome determination result,the case where no information is sent may also be considered to beequivalent to the case where the determination result is sent.

Next, a description will be given of the processing performed by theimage processing apparatus 300 having received the pieces of data suchas the PDL data, the image processing parameters, and thecolor/monochrome determination result. In step S404, the imageprocessing apparatus 300 receives, by the communication control unit301, the data transferred via the network 201, and stores the data inthe RAM included in the control unit 307.

In step S405, the control unit 307 sets, among the received imageprocessing parameters, a parameter related to rendering processing,where the set attribute may be utilized with respect to the renderingunit 302 and the monochrome/color determination unit 303. The parameterrelated to the rendering processing corresponds to, for example,attribute information indicating the attribute of an object, which willbe described below. After the parameter has been set, then in step S406,the rendering unit 302 performs the rendering processing on the receivedPDL data. This converts the PDL data into bitmap image data.

Next, in step S407, the monochrome/color determination unit 303 performscolor/monochrome determination processing using the bitmap image dataconverted by the rendering unit 302. The processing will be described indetail below. Then, in step S408, the control unit 307 sets parametersrelated to the printing processing in the color space conversion unit304, the halftone processing unit 305, and the printing unit 306. Theseparameters include parameters generated based on the color/monochromedetermination result of the determination made by the host computer 200in step S403, a gray compensation flag described below, and thecolor/monochrome determination result of the determination made by themonochrome/color determination unit 303 in step S407. Further, theparameters include other parameters received from the host computer 200.

In step S409, after the color space conversion unit 304 and the halftoneprocessing unit 305 have performed image processing, the printing unit306 performs the printing processing on the bitmap image. Finally, instep S410, based on the color/monochrome determination results in stepsS403 and S407, the control unit 307 counts up the value of either ofcolor and monochrome page counters, and ends the printing processing.

FIG. 5 is a flow chart illustrating the details of the processing in thecolor/monochrome determination processing in step S403 on the hostcomputer 200 side. The following processing is performed by the drivercontrol unit 203.

First, in step S501, the driver control unit 203 confirms an output modesetting made by a user. The output mode setting refers to the setting ofthe color mode of the document image to be printed. The setting of thecolor mode includes, for example, three types of settings such as (1)color, (2) monochrome, and (3) automatic determination. The user canspecify any one of the settings through a user interface (UI) of theprinter driver. At this time, if “color” has been set, the document tobe printed from the document image is determined as a color document. Inother words, the document to be printed from the document image isdetermined to be a color document. If “monochrome” has been set, thedocument to be printed from the document image is determined as amonochrome document. If “automatic determination” has been set, theprinter driver confirms objects in the document image to automaticallydetermine whether the document to be printed from the document image isa color document or a monochrome document. The processing flow will bedescribed below.

If the output mode is set to “color” (“COLOR” in step S501), theprocessing proceeds to step S504. In step S504, the driver control unit203 determines all the pages as a color document. If the output mode isset to “monochrome” (“MONOCHROME” in step S501), the processing proceedsto step S505. In step S505, the driver control unit 203 determines allthe pages as a monochrome document.

If, on the other hand, the output mode is set to “automaticdetermination” (“AUTOMATIC” in step S501), then in step S502, the drivercontrol unit 203 confirms objects in the generated PDL data, makescolor/monochrome determination of each object, and makescolor/monochrome determination of each page. If all the objects in thepage have already been confirmed in step S502, that is, if a colorobject is not included in the page (Yes in step S502), the processingproceeds to step S505. In step S505, the driver control unit 203determines the document image on the page as a monochrome document. Ifthere are objects that have not yet been confirmed (No in step S502),then in step S503, the driver control unit 203 determines, based on thePDL data, whether the objects are color objects. If at least one of theobjects is a color object (Yes in step S503), the processing proceeds tostep S504. In step S504, the driver control unit 203 determines thedocument image to be printed as a color document. If the objects are notcolor objects (No in step S503), the processing returns to step S502. Instep S502, the driver control unit 203 makes color/monochromedetermination of all the objects. The technique for sending thecolor/monochrome determination result obtained like this has beendescribed above.

FIG. 6 is a diagram illustrating the relationships between the settingof the output mode, and the result of the color/monochrome determinationin step S403 in the host computer 200, and the result of thecolor/monochrome determination in step S407 in the image processingapparatus 300, which will be described in detail below. In the presentexemplary embodiment, if the output mode is set to “color” (*1 in thetable), the determination of whether the document image is a colordocument or a monochrome document is left to the color/monochromedetermination in the image processing apparatus 300 at the subsequentstage. Further, if the output mode is set to “automatic determination”and the host computer 200 has determined the document image as a colordocument (*1 in the table), the determination of whether the documentimage is a color document or a monochrome document is left to thecolor/monochrome determination in the image processing apparatus 300 atthe subsequent stage. Thus, in these cases (the cases of *1), thedetermination result of the color/monochrome determination in step S407in the image processing apparatus 300 is valid. If, on the other hand,the output mode is set to “monochrome” (*2 in the table), the documentimage is treated as a monochrome document in step S403 and all thesubsequent steps. Further, if the output mode is set to “automaticdetermination” and the host computer 200 has determined the documentimage as a monochrome document (*2 in the table), the document image istreated as a monochrome document in step S403 and all the subsequentsteps. That is, in these cases (the cases of *2), the determinationresult of the color/monochrome determination in step S407 in the imageprocessing apparatus 300 is invalid. Thus, if the printer driver hasdetermined the document image as a monochrome document, the processingin step S407 of FIG. 4 may be skipped.

FIG. 7 is a flow chart illustrating the details of the processing in thecolor/monochrome determination in step S407 in the image processingapparatus 300, which plays a central role in the present exemplaryembodiment. The following processing is performed by themonochrome/color determination unit 303.

First, in step S701, the monochrome/color determination unit 303initializes counters for counting color pixels and monochrome pixels inthe bitmap image data on each page. Next, in step S702 and thesubsequent steps, the monochrome/color determination unit 303 makescolor/monochrome determination of each pixel in the input bitmap imagedata. Initially, in step S702, the monochrome/color determination unit303 determines whether a focused pixel in the image is a white pixel.The determination of whether the focused pixel is a white pixel is madeas follows. For example, in the case of 8-bit RGB image data, a pixel inwhich R=G=B=255 is determined as a white pixel. If the focused pixel isa white pixel (Yes in step S702), the processing proceeds to step S706.In step S706, the monochrome/color determination unit 303 determines thefocused pixel as a monochrome pixel, and increments the monochrome pixelcounter. If, on the other hand, the focused pixel is not a white pixel(No in step S702), the processing proceeds to step S703. In step S703,the monochrome/color determination unit 303 determines whether a graycompensation flag of the focused pixel is on.

The gray compensation flag will be described here. The gray compensationflag refers to a flag indicating whether gray compensation is set. Thegray compensation setting is image processing setting made by the userfor the driver control unit 203, and is made to set whether the pixeldetermined as a gray pixel is to be represented by a single K color orrepresented by four CMYK colors. The gray compensation setting can bemade with respect to each object type such as image, graphic, or text.If the gray compensation flag is on, gray compensation is made. That is,the pixel determined as a gray pixel is represented by a single K color.If the gray compensation flag is off, gray compensation is not made.That is, the pixel determined as a gray pixel is represented by fourCMYK colors. In a normal driver, gray compensation is often set to offfor an image object, and gray compensation is often set to on forgraphic and text objects. That is, gray compensation is often set to offfor a photograph pixel, and is often set to on for a graphic pixel and atext pixel. Based on such settings, a gray color of an image object isrepresented by four CMYK colors and thereby can represent a richimpression of color. A gray color of a graphic object or a text objectis represented by a single K color and thereby can reduce the thickeningand the blurring of a line. Further, the initial setting value of thegray compensation setting with respect to each object type may varydepending on the driver. The gray compensation setting thus made withrespect to each object type is converted into the gray compensation flagof each pixel, and the gray compensation flag is added to the pixel,when the rendering unit 302 converts the PDL data into a bitmap image.Then, the gray compensation flag is used for the determination by themonochrome/color determination unit 303 at the subsequent stage.

Taking a white rectangular object as an example, a description will begiven of the difference between the case where the attribute of theobject type is “graphic” and the case where the attribute of the objecttype is “image”. As described above, the driver control unit 203generates PDL data based on the data transferred from the applicationcontrol unit 202. At this time, if the data transferred from theapplication control unit 202 is a so-called white rectangular figure,the driver control unit 203 generates PDL data defining the vertexpositions and the lengths of the rectangle. The rendering unit 302 ofthe image processing apparatus 300 analyzes the PDL data and adds“graphic” as the attribute of the PDL data. If, on the other hand, thedata transferred from the application control unit 202 is so-calledbitmap (BMP) or Joint Photographic Experts Group (JPEG) image data, thedriver control unit 203 generates PDL data indicating such image data.The rendering unit 302 of the image processing apparatus 300 analyzesthe PDL data and adds “image” as the attribute of the PDL data.

Referring back to the flow chart in FIG. 7, the description will becontinued. If the gray compensation flag of the focused pixel is off instep S703 (No in step S703), the focused pixel is represented by fourCMYK colors by the color space conversion unit 304 at the subsequentstage. Thus, the processing proceeds to step S705. In step S705, themonochrome/color determination unit 303 determines the focused pixel asa color pixel, and increments the color pixel counter.

If, on the other hand, the gray compensation flag of the focused pixelis on (Yes in step S703), the processing proceeds to step S704. In stepS704, the monochrome/color determination unit 303 determines whether thefocused pixel is a gray pixel. In other words, the monochrome/colordetermination unit 303 determines whether the focused pixel constitutesa gray text. The determination of whether the focused pixel is a graypixel is made as follows. For example, in the case of an RGB image, apixel of R=G=B is determined as a gray pixel. The other pixels aredetermined as not gray pixels. If the gray compensation flag is on, andthe focused pixel is a gray pixel (Yes in step S704), the focused pixel,which is a gray pixel, is represented by a single K color. Thus, theprocessing proceeds to step S706. In step S706, the monochrome/colordetermination unit 303 determines the focused pixel as a monochromepixel, and increments the monochrome pixel counter. If the focused pixelis not a gray pixel (No in step S704), the processing proceeds to stepS705. In step S705, the monochrome/color determination unit 303determines the focused pixel as a color pixel, and increments the colorpixel counter. In step S707, the monochrome/color determination unit 303determines whether the above determination processing has been performedon all the pixels included in the rendered bitmap image data on onepage. If there is a pixel that has not been subjected to the abovedetermination processing (No in step S707), the above determinationprocessing is repeated by setting the pixel that has not been subjectedto the above determination processing as a focused pixel.

If all the pixels have been subjected to the above determinationprocessing (Yes in step S707), then in step S708, the monochrome/colordetermination unit 303 determines, based on the counted values of thecolor pixel counter and monochrome pixel counter, whether the image onthe one page includes a color pixel. For example, in the presentexemplary embodiment, if the color pixel counter indicates a value equalto or greater than 1 (Yes in step S708), then in step S709, themonochrome/color determination unit 303 determines the document image onthis page as a color document. In other cases (No in step S708), in stepS710, the monochrome/color determination unit 303 determines thedocument image on this page as a monochrome document. According to theresult of step S709 or S710, it is determined whether this page has beensubjected to color printing or monochrome printing.

In the present exemplary embodiment, the monochrome/color determinationunit 303 makes color/monochrome pixel determination of all the pixels onone page, and then makes color/monochrome document determination basedon the resulting pixel counters. The determination method, however, isnot limited to such a method. More specifically, the method may be suchthat if at least one color pixel has been detected, the monochrome/colordetermination unit 303 does not make determination processingthereafter, or the CPU of the control unit 307 performs the processes instep S708 and the subsequent steps. The former can reduce the amount ofprocessing when software performs the processing while the latter canflexibly change an algorithm of the color/monochrome documentdetermination based on the color and monochrome pixel counters.

Further, the above processing has been described taking as an example atechnique for providing counters and counting up the respective countervalues of color pixels and monochrome pixels. However, since it is onlynecessary to identify whether the document on each page is a colordocument or a monochrome document, for example, 1-bit flag data may beused. More specifically, the technique may be such that a monochromeprinting flag is set as an initial setting, and if a focused pixel hasbeen determined as a color pixel in the above color/monochromedetermination processing in the image processing apparatus 300, a colorprinting flag is set.

FIG. 8 illustrates a table indicating the determination results of thecolor/monochrome pixel determination made based on the pixel value andthe gray compensation flag, in the color/monochrome pixel determinationin step S407. In the above determination processing in step S407, awhite pixel is determined as a monochrome pixel regardless of the graycompensation flag. This is because, if the focused pixel is determinedas a white pixel in step S702, the focused pixel is immediatelydetermined as a monochrome pixel without performing the subsequentdetermination processing using the gray compensation flag and the like.In the present exemplary embodiment, if the focused pixel is a whitepixel, the focused pixel is determined as a monochrome pixel. This canprevent a document image including only a white image, for example, frombeing determined as a color image. Further, in the determinationprocessing in step S407, a color pixel is determined as a color pixelregardless of the gray compensation flag. At this time, a color pixelrefers to a pixel other than a white pixel (R=G=B=255), a gray pixel(R=G=B), and a black pixel (R=G=B=0).

On the other hand, each of a gray pixel and a black pixel is determinedas a monochrome pixel if the gray compensation flag is on, or isdetermined as a color pixel if the gray compensation flag is off. Thatis, in the case of an object type (e.g., “text” or “graphic”) for whichgray compensation is set (is on), each of a gray pixel and a black pixelis determined as a monochrome pixel. In the case of an object type(e.g., “image” or an object having no attribute) for which graycompensation is not set (is off), each of a gray pixel and a black pixelis determined as a color pixel.

According to the determination flow as described above, a descriptionwill be given of a determination flow in a case where, for example, aprint job of an image as illustrated in FIG. 1 has been input with theoutput mode set to “color”. First, in the host computer 200, since theoutput mode is set to “color”, the document to be printed from the imageis determined as a color document in the processing of step S403. Next,in the image processing apparatus 300, since a pixel in a white imageobject 102 is a white pixel, the pixel is determined as a monochromepixel regardless of the setting of the gray compensation flag. Further,in each of black text objects 104 and 105, the setting of the graycompensation flag, which is set to on for a text portion, is valid.Thus, pixels in the black text objects 104 and 105 are also determinedas monochrome pixels. As a result, the image in FIG. 1 is determined asa monochrome image.

As described above, gray compensation is often set to off for theattribute “image” to represent a rich impression of color. Consequently,in the case as illustrated in FIG. 1, although the white image object102 is not subjected to color printing, the pixel in the white imageobject 102 is determined as a color pixel. As a result, a color printingfee has been charged. According to the present exemplary embodiment, thediscrepancy between the appearance of a document image as illustrated inFIG. 1 and the color/monochrome determination result of the documentimage can be resolved.

In the example illustrated in FIG. 1, if the output mode is set to“automatic determination”, a monochrome printing fee is charged evenaccording to a conventional technique. This is because, in thecolor/monochrome determination processing in the host computer 200 (stepS403), the objects are determined as non-color objects, and therefore,the image is treated as a monochrome document in the subsequentprocessing.

FIG. 9 illustrates another example. FIG. 9 illustrates a document image900, in which a white image object 902 (although the frame line of theimage object 902 is represented in black for illustrative purposes, theimage object 902 is actually white) is superimposed on a color textobject 901. An object 903 defined by dashed lines indicates that thecolor text object 901 cannot be seen behind the white image object 902.In the case of a document image as illustrated in FIG. 9, even if theoutput mode of the printer driver is set to “automatic determination”, acolor printing fee is charged according to a conventional technique,despite the fact that there is no pixel to be printed in color. That is,the color text object 901 is placed behind the white image object 902and therefore is not printed. Further, in the white image object 902,R=G=B=255. Thus, the values after CMYK conversion are C=M=Y=K=0.Accordingly, there is no pixel to be printed in color.

Even in the case of a document image as illustrated in FIG. 9, accordingto the processing of the present exemplary embodiment, a monochromeprinting fee is charged for the document image 900 even if the outputmode is set to “automatic determination” or “color”.

This case will be specifically described. A description will be given ofa determination flow in a case where a print job of a document image asillustrated in FIG. 9 has been input with the output mode set to“automatic determination”. First, in the host computer 200, as a resultof the processing of the color/monochrome determination processing inthe host computer 200 (step S403), the image is determined as includinga color object and therefore the document to be printed from the imageis determined as a color document. Also in a case where the output modeis set to “color”, the document to be printed from the image issimilarly determined as a color document. Next, in the image processingapparatus 300, an image portion where the white image object 902 issuperimposed on the color text object 901 is white also in the renderedbitmap data. Thus, a pixel in the image portion is determined as amonochrome pixel regardless of the setting of the gray compensationflag. Further, in each of black text objects 904 and 905, the setting ofthe gray compensation flag, which is set to on for a text portion, isvalid. Thus, pixels in the black text objects 904 and 905 are alsodetermined as monochrome pixels. As a result, the document image 900 inFIG. 9 is determined as a monochrome image.

As described above, according to the processing of the present exemplaryembodiment, the discrepancy between the appearance of a document imageas illustrated in FIG. 9 and the color/monochrome determination resultof the document image can be resolved.

In the first exemplary embodiment, an example has been illustrated wherestrict determination is made in each type of determination including thewhite pixel determination (step S702), the gray pixel determination(step S704), and the color/monochrome document determination (step S708)in the color/monochrome determination (step S407) in the imageprocessing apparatus 300. More specifically, in the white pixeldetermination processing in step S702, an example has been illustratedwhere, for an 8-bit RGB image, only a pixel in which R=G=B=255 isdetermined as a white pixel. Further, in the gray pixel determinationprocessing in step S704, an example has been illustrated where only apixel in which R=G=B is determined as a gray pixel. Further, in thecolor/monochrome document determination processing in step S708, anexample has been illustrated where, if there is at least one colorpixel, the document to be printed from the document image is determinedas a color document.

It is, however, easier to obtain effects by allowing determination usingcertain thresholds rather than by making strict determination, so longas the purpose of resolving the discrepancy between the appearance of animage and the color/monochrome determination result of the image isaccomplished.

For example, in the white pixel determination processing in step S702,if a pixel to be printed in a color similar to white is determined as amonochrome pixel, the discrepancy between the appearance of an image andthe color/monochrome determination result of the image is furtherresolved. Thus, while a pixel in which R=G=B=255 is determined as awhite pixel in the first exemplary embodiment, a predetermined thresholdTH1 (e.g., TH1=252) may be alternatively used to determine a pixel inwhich R≧TH1, G≧TH1, and B≧TH1 as a white pixel. Similarly, in the graypixel determination processing in step S704, while only a pixel in whichR=G=B is determined as a gray pixel in the first exemplary embodiment, apredetermined threshold TH2 (e.g., TH2=3) may be alternatively used todetermine a pixel in which |R−G|≦TH2, |G−B|≦TH2, and |B−R|≦TH2 as a graypixel. Further, in the color/monochrome document determinationprocessing in step S708 as well, while a document to be printed from thedocument image which includes at least one color pixel is determined asa color document in the first exemplary embodiment, a predeterminedthreshold TH3 (e.g., 30) may be alternatively used to determine adocument image in which the number of color pixels >TH3 as a colordocument. If a flag is used, the technique may be such that a color flagis set when the threshold TH3 has been exceeded.

As described above, providing a mechanism for allowing latitude indetermination using a threshold in each determination process, andsetting an appropriate threshold can further resolve the discrepancybetween the appearance of an image and the color/monochromedetermination result of the image. Further, if a threshold is madevariable, it is possible to construct a flexible color/monochromedetermination system.

Further, an exemplary embodiment of the present invention is achievedalso by performing the following processing. More specifically, anexemplary embodiment of the present invention is achieved by performingthe processing of supplying software (a program) for achieving thefunctions of the above exemplary embodiments to a system or an apparatusvia a network or various storage media, and of causing a computer (or aCPU or a microprocessor unit (MPU)) of the system or the apparatus toread and execute the program.

Embodiments of the present invention can also be realized by a computerof a system or apparatus that reads out and executes computer executableinstructions recorded on a storage medium (e.g., non-transitorycomputer-readable storage medium) to perform the functions of one ormore of the above-described embodiment(s) of the present invention, andby a method performed by the computer of the system or apparatus by, forexample, reading out and executing the computer executable instructionsfrom the storage medium to perform the functions of one or more of theabove-described embodiment(s). The computer may comprise one or more ofa central processing unit (CPU), micro processing unit (MPU), or othercircuitry, and may include a network of separate computers or separatecomputer processors. The computer executable instructions may beprovided to the computer, for example, from a network or the storagemedium. The storage medium may include, for example, one or more of ahard disk, a random-access memory (RAM), a read only memory (ROM), astorage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™),a flash memory device, a memory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2014-007915 filed Jan. 20, 2014, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. A printing apparatus to charge a color printingfee in a case where a pixel for which a color printing flag is set ispresent in an input image, and to charge a black-and-white printing feein a case where a pixel for which the color printing flag is set is notpresent in an input image, the printing apparatus comprising: a whitedetermination unit configured to determine whether a focused pixel inthe input image is a white pixel; a gray text determination unitconfigured to determine whether the focused pixel constitutes a graytext; and a setting unit configured to, in a case where the focusedpixel is determined to constitute a gray text or be a white pixel, set ablack-and-white printing flag for the focused pixel and, in a case wherethe focused pixel is determined to neither constitute a gray text nor bea white pixel, set the color printing flag for the focused pixel.
 2. Theprinting apparatus according to claim 1, wherein the input image is anRGB (Red, Green, Blue) image, the printing apparatus further comprising:a conversion unit configured to, in a case where the black-and-whiteprinting flag is set for the focused pixel, convert RGB values of thefocused pixel into CMYK (Cyan, Magenta, Yellow, Key) values in whichC=M=Y=0 and, in a case where the color printing flag is set for thefocused pixel, convert the RGB values of the focused pixel into CMYKvalues in which at least one of the C, M, and Y values is greater than 0except in a case where R=G=B=0.
 3. The printing apparatus according toclaim 2, further comprising a printing unit configured to print an imageobtained by the conversion performed by the conversion unit.
 4. Theprinting apparatus according to claim 2, wherein, in a case where theRGB values of the focused pixel are (255,255,255), the focused pixel isdetermined to be a white pixel.
 5. The printing apparatus according toclaim 2, wherein, in a case where all of the RGB values of the focusedpixel exceed a predetermined threshold, the focused pixel is determinedto be a white pixel.
 6. The printing apparatus according to claim 2,wherein, in a case where the focused pixel is determined to be gray, anddetermined to be a pixel constituting a text, the focused pixel isdetermined to constitute a gray text.
 7. The printing apparatusaccording to claim 6, wherein, in a case where the RGB values of thefocused pixel are R=G=B, the focused pixel is determined to be gray. 8.The printing apparatus according to claim 6, wherein, in a case where,in the RGB values of the focused pixel, a difference between the R andthe G values, a difference between the G and the B values, and adifference between the B and the R values are smaller than apredetermined threshold, the focused pixel is determined to be gray. 9.An image processing apparatus comprising: a white determination unitconfigured to determine whether each pixel in an input image is a whitepixel; a gray determination unit configured to determine whether eachpixel in the input image is a gray pixel; and a text determination unitconfigured to determine whether each pixel in the input image is a textpixel, wherein, in a first case where the white determination unitdetermines that a focused pixel is a white pixel, a black-and-whiteprinting flag is set for the focused pixel, wherein, in a second casewhere the white determination unit determines that the focused pixel isnot a white pixel, the gray determination unit determines that thefocused pixel is a gray pixel, and the text determination unitdetermines that the focused pixel is a text pixel, the black-and-whiteprinting flag is set for the focused pixel, and wherein in a case otherthan the first case and the second case, a color printing flag is setfor the focused pixel.
 10. An image processing apparatus comprising: awhite determination unit configured to determine whether each pixel inan input image is a white pixel; a text determination unit configured todetermine whether each pixel in the input image constitutes a text; anda setting unit configured to set, in a case where the whitedetermination unit determines that a focused pixel is a white pixel, ablack-and-white printing flag for the focused pixel regardless of adetermination result of the text determination unit.
 11. An imageprocessing apparatus comprising: a white determination unit configuredto determine whether each pixel in an image is a white pixel; a chromedetermination unit configured to determine whether each pixel in theimage is a black-and-white pixel or a color pixel; an attributedetermination unit configured to determine whether each pixel in theimage is a photograph pixel or a text pixel; and a setting unitconfigured to: in a case where the white determination unit determinesthat a focused pixel is a white pixel, set a black-and-white printingflag for the focused pixel regardless of results of determinations ofthe focused pixel by the chrome determination unit and/or the attributedetermination unit, in a case where the white determination unitdetermines that the focused pixel is not a white pixel, set a colorprinting flag for the focused pixel in a case where the chromedetermination unit determines that the focused pixel is ablack-and-white pixel, and the attribute determination unit determinesthat the focused pixel is a photograph pixel, and in a case where thewhite determination unit determines that the focused pixel is not awhite pixel, set the black-and-white printing flag for the focused pixelin a case where the chrome determination unit determines that thefocused pixel is a black-and-white pixel, and the attributedetermination unit has determined that the focused pixel is a textpixel.
 12. A method for a printing apparatus to charge a color printingfee in a case where a pixel for which a color printing flag is set ispresent in an input image, and to charge a black-and-white printing feein a case where a pixel for which the color printing flag is set is notpresent in an input image, the method comprising: determining whether afocused pixel in the input image is a white pixel; determining whetherthe focused pixel constitutes a gray text; and in a case where thefocused pixel is determined to constitute a gray text or be a whitepixel, setting a black-and-white printing flag for the focused pixeland, in a case where the focused pixel is determined to neitherconstitute a gray text nor be a white pixel, setting the color printingflag for the focused pixel, wherein at least one step is implemented byat least one processor.
 13. A non-transitory computer-readable storagemedium storing a program to cause a printing apparatus to perform amethod to charge a color printing fee in a case where a pixel for whicha color printing flag is set is present in an input image, and to chargea black-and-white printing fee in a case where a pixel for which thecolor printing flag is set is not present in an input image, the methodcomprising: determining whether a focused pixel in the input image is awhite pixel; determining whether the focused pixel constitutes a graytext; and in a case where the focused pixel is determined to constitutea gray text or be a white pixel, setting a black-and-white printing flagfor the focused pixel and, in a case where the focused pixel isdetermined to neither constitute a gray text nor be a white pixel,setting the color printing flag for the focused pixel, wherein at leastone step is implemented by at least one processor.